package net.kts.help;

import android.app.Activity;
import android.content.SharedPreferences;

public class HelpPreferences {
	private static SharedPreferences sharedPreferences;
	private static boolean isShowing;
	
	public static void setHelpPreferences(Activity activity) {
		sharedPreferences = activity.getSharedPreferences("Help", Activity.MODE_PRIVATE);
		isShowing = sharedPreferences.getBoolean("show", true);
	}
	
	public static void off(){
		SharedPreferences.Editor insSharedPrefEditor = sharedPreferences.edit();
		insSharedPrefEditor.putBoolean("show", false);
		insSharedPrefEditor.commit();
		isShowing = false;
	}
	public static void on(){
		SharedPreferences.Editor insSharedPrefEditor = sharedPreferences.edit();
		insSharedPrefEditor.putBoolean("show", true);
		insSharedPrefEditor.commit();
		isShowing = true;
	}
	
//	public static boolean isShowing(String name){
//		if(isShowing == false)
//			return isShowing;
//		if(HelpPreferences.isShows(name)){
//			setNotShows(name);
//			return true;
//		}
//		return false;
//	}
	public static boolean isShowing(){
		return isShowing;
	}
	public static boolean isShows(String name){
		return sharedPreferences.getBoolean("show"+name, true);
	}
	
	public static void setNotShows(String name){
		SharedPreferences.Editor insSharedPrefEditor = sharedPreferences.edit();
		insSharedPrefEditor.putBoolean("show"+name, false);
		insSharedPrefEditor.commit();
	}
}
